#pragma once
#include <QObject>
#include <QTcpSocket>
#include <vector>
#include "protocol.h"

class QCommand :public QObject
{
    Q_OBJECT
protected:
    QTcpSocket* mSocket;
public:
    QCommand(QTcpSocket* socket){mSocket=socket;}
protected:
    inline void command(unsigned int len, const char* data){
        QByteArray array;
        iepe_package package{0xaa00ff55,len};
        array.append((char*)&package,sizeof(iepe_package)-1);
        array.append(data,len);
        mSocket->write(array);
    }
    
};

